package designpattern.single;

//单例模式的实现2(有线程安全问题)
public class Singleton {


    private static Singleton singleton = null;

    private Singleton() {
    }


   synchronized   public  static Singleton getSingleton() {

        if (singleton == null) {

            singleton = new Singleton();
        }

        return singleton;
    }


}
